﻿<script type="text/javascript">
    function init() {
        navigator.geolocation.getCurrentPosition(function (position) {
            var coords = position.coords;
            var latitude = coords.latitude;
            var longitude = coords.longitude;
            document.getElementById("location").innerHTML = "current position latitude:" + latitude + ";longitude:" + longitude;
        });
    }

</script>
<!DOCTYPE html>
<html>
    <head>
        <title></title>
    </head>
    <body onload="init()">
        <p id="location">test</p>
    </body>
</html>